<?php
class User extends Guest
{
	
	 /**
	 * The Competency database adapter Layer
	 * @var UserCompetencyTable
	 */
	protected $_usercompetencytable;
	 /**
	 * The Competency database adapter Layer
	 * @var CompetencyTable
	 */
	protected $_competencytable;
	
	/**
	 * The user database adapter
	 * @var UserTable
	 */
	protected $_usertable;
	
	
	public function __construct()
	{
		$_usertable = new UserTable();
	}
	/**
	 *	Update the user profile information
	 *	username, password, birthday, gender, description 
	 *	education, workexperience
	 *  etc... 
	 * 
	 * @param array $profile
	 */
	public function updateProfile(array $profile)
	{
		//check the profile is correct or not
		$this->usertable->update($profile);
	}
	
	/**
	 * Add User's competency from the template or customer defined
	 * @param array $competency
	 */
	public function addCompetency()
	{
		$this->usercompetencytable->add($competency);
	}

	/**
	 * update User's competency from the selected
	 * @param array $competency
	 */
	public function updateCompetency(array $competency)
	{
		$this->usercompetencytable->add($competency);
	}
	
	/**
	 * delete User's competency from the list
	 * @param array $competency
	 */
	public function deleteCompetency(array $competency)
	{
		$this->usercompetencytable->add($competency);
	}
	
	
	/**
	 * Add Work  Experience
	 * @param array $workexp
	 */
	public function addWorkExperience()
	{
	
	}
	
	/**
	 * Update work experience
	 * @param array $workexp
	 */
	public function updateWorkExperience()
	{
	
	}
	
	/**
	 * delete work experience
	 * @param array $workexp
	 */
	public function deleteWorkExperience()
	{
	
	}

	
	/**
	 * Enter description here ...
	 * @param array $education
	 */
	public function addEducation()
	{
	
	}
	
	/**
	 * Enter description here ...
	 * @param array $education
	 */
	public function updateEducation(array $education)
	{
	
	}
	
	
	/**
	 * Enter description here ...
	 * @param array $param
	 */
	public function addFriend(array $param) {
		
	}
	
	/**
	 * Enter description here ...
	 * @param array $param
	 */
	public function updateFriend(array $param) {
		
	}
	
	/**
	 * Enter description here ...
	 * @param array $param
	 */
	public function deleteFriend(array $param) {
		
	}
	
	/**
	 * Enter description here ...
	 * @param array $education
	 */
	public function deleteEducation(array $education)
	{
	
	}
	
	public function getUsebyUID($uid)
	{
		$query = $this->_db->select()
		->from("user",array("name,nickname"))
		->where("uid=?","wangxi9o");
		$query->getAdapter()->fetchAll();
		//$db = Zend_Registry::get("db");
		//$db->
		//$query = $db->select();
		//$query->->fetchall();
	}


	/**
	 * The Function to validate the user is available or not
	 * @param User $user
	 */
	public function isAuthenticated($user)
	{
			
	}
}